package cn.com.hbhgkj.model;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlRootElement;

import org.apache.commons.lang3.StringUtils;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;

import cn.com.hbhgkj.Constants;
import cn.com.hbhgkj.util.IgnoreNameValuePair;

@Entity
@Table(name="crs_copyright_alteration")
@Indexed
@XmlRootElement
public class CopyrightAlteration extends BaseObject implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@IgnoreNameValuePair
    private Long id;
    private String loginId;
    @IgnoreNameValuePair
    private String copyrighter;
    private String proveFile;
    private String kind;
    private String softFullName;
    private String originalRegType;
    private String originalRegNumber;
    private String originalChangeNumber;
    private String applyingType;
    
    private String items;
    private String beforeContent;
    private String afterContent;
    
    @IgnoreNameValuePair
    private AlterationItem[] alterationItems;
    @IgnoreNameValuePair
    private SupplyItem supplyItem;
    
    @Transient 
    public SupplyItem getSupplyItem() {
    	SupplyItem result = new SupplyItem();
    	if(items == null || isAlterationReg()){
    		result.setSupplyType("");
    		result.setSupplyOrigContent("");
    		result.setSupplyAlteredContent("");
    		return result;
    	}
    	
    	result.setSupplyType(items);
    	result.setSupplyOrigContent(this.beforeContent);
    	result.setSupplyAlteredContent(this.afterContent);
    	return result;
    }
    
    @Transient 
    public boolean isAlterationReg(){
    	return this.applyingType.equals("变更登记") ? true : false;
    }
    
    @Transient 
    public AlterationItem[] getAlterationItems() {
    	
    	AlterationItem ai = null;
    	
    	if(items == null || !isAlterationReg()){
    		alterationItems = new AlterationItem[1];
    		ai = new AlterationItem();
    		ai.setAlterationType("");
    		ai.setOriginalContent("");
    		ai.setAlteredContent("");
    		alterationItems[0] = ai;
    		return alterationItems;
    	}
    	String[] alterationTypes = items.split(";;;;");
    	String[] origContents = beforeContent.split(";;;;");
    	String[] newlyContents = afterContent.split(";;;;");
    	alterationItems = new AlterationItem[alterationTypes.length];
    	for(int i= 0 ; i < alterationTypes.length ; i ++){
    		ai = new AlterationItem();
    		ai.setAlterationType(alterationTypes[i]);
    		ai.setOriginalContent(origContents[i]);
    		ai.setAlteredContent(newlyContents[i]);
    		alterationItems[i] = ai;
    	}
		return alterationItems;
	}

	/*public void setAlterationItems(List<AlterationItem> alterationItems) {
		this.alterationItems = alterationItems;
	}*/

	/*private String items2;
    private String beforeContent2;
    private String afterContent2;
    private String items1;
    private String beforeContent1;
    private String afterContent1;*/
    
    private String reason;
    private String applyType;
    private String shenqr;
    private String dailr;
    private String sqrname;
    private String sqraddress;
    private String sqrpostCode;
    private String sqrcontactPerson;
    private String sqrphone;
    private String sqremail;
    private String sqrmobile;
    private String sqrfax;
    private String agentDesc;
    private String dlrname;
    private String dlraddress;
    private String dlrpostCode;
    private String dlrcontactPerson;
    private String dlrphone;
    private String dlremail;
	private String dlrmobile;
	private String dlrfax;
	
	@Column(name="dlremail", length=50)
    @Field
    public String getDlremail() {
		return Constants.AGENT_EMAIL;
	}

	public void setDlremail(String dlremail) {
		this.dlremail = dlremail;
	}
	
	@Column(name="dlrmobile", length=50)
    @Field
	public String getDlrmobile() {
		return Constants.AGENT_MOBILE;
	}

	public void setDlrmobile(String dlrmobile) {
		this.dlrmobile = dlrmobile;
	}

	@Column(name="dlrfax", length=50)
    @Field
	public String getDlrfax() {
		return Constants.AGENT_FAX;
	}

	public void setDlrfax(String dlrfax) {
		this.dlrfax = dlrfax;
	}

	@IgnoreNameValuePair
	private Integer state;
	@IgnoreNameValuePair
    private Date applyTime;
	@IgnoreNameValuePair
    private Date updateTime;
    
	@IgnoreNameValuePair
    private User applicant;
	@IgnoreNameValuePair
    private User reviewer;

    @Id @GeneratedValue(strategy=IDENTITY) @DocumentId    
    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    @Column(name="loginId", length=50)
    @Field
    public String getLoginId() {
        return this.loginId;
    }
    
    public void setLoginId(String loginId) {
        this.loginId = loginId;
    }
    
    @Column(name="copyrighter", length=50)
    @Field
    public String getCopyrighter() {
        return this.copyrighter;
    }
    
    public void setCopyrighter(String copyrighter) {
        this.copyrighter = copyrighter;
    }
    
    @Column(name="proveFile", length=50)
    @Field
    public String getProveFile() {
        return "原登记证书复印件,申请者身份证明文件,代理人委托书,代理人身份证明文件";
    }
    
    public void setProveFile(String proveFile) {
        this.proveFile = proveFile;
    }
    
    @Column(name="kind", length=50)
    @Field
    public String getKind() {
        return "R41";
    }
    
    public void setKind(String kind) {
        this.kind = kind;
    }
    
    @Column(name="softFullName", length=50)
    @Field
    public String getSoftFullName() {
        return this.softFullName;
    }
    
    public void setSoftFullName(String softFullName) {
        this.softFullName = softFullName;
    }
    
    @Column(name="originalRegType", length=50)
    @Field
    public String getOriginalRegType() {
    	if(StringUtils.isEmpty(originalRegType))
    		return "软件著作权登记";
        return this.originalRegType;
    }
    
    public void setOriginalRegType(String originalRegType) {
        this.originalRegType = originalRegType;
    }
    
    @Column(name="originalRegNumber", length=50)
    @Field
    public String getOriginalRegNumber() {
        return this.originalRegNumber;
    }
    
    public void setOriginalRegNumber(String originalRegNumber) {
        this.originalRegNumber = originalRegNumber;
    }
    
    @Column(name="originalChangeNumber", length=50)
    @Field
    public String getOriginalChangeNumber() {
        return this.originalChangeNumber;
    }
    
    public void setOriginalChangeNumber(String originalChangeNumber) {
        this.originalChangeNumber = originalChangeNumber;
    }
    
    @Column(name="applyingType", length=50)
    @Field
    public String getApplyingType() {
    	if(StringUtils.isEmpty(applyingType))
    		return "变更登记";
        return this.applyingType;
    }
    
    public void setApplyingType(String applyingType) {
        this.applyingType = applyingType;
    }
    
    @Column(name="items", length=500)
    @Field
    public String getItems() {
        return this.items;
    }
    
    public void setItems(String items) {
        this.items = items;
    }
    
    @Column(name="beforeContent", length=2000)
    @Field
    public String getBeforeContent() {
        return this.beforeContent;
    }
    
    public void setBeforeContent(String beforeContent) {
        this.beforeContent = beforeContent;
    }
    
    @Column(name="afterContent", length=2000)
    @Field
    public String getAfterContent() {
        return this.afterContent;
    }
    
    public void setAfterContent(String afterContent) {
        this.afterContent = afterContent;
    }
    
   /* @Column(name="items2_", length=50)
    @Field
    public String getItems2() {
        return this.items2;
    }
    
    public void setItems2(String items2) {
        this.items2 = items2;
    }
    
    @Column(name="beforeContent2_", length=150)
    @Field
    public String getBeforeContent2() {
        return this.beforeContent2;
    }
    
    public void setBeforeContent2(String beforeContent2) {
        this.beforeContent2 = beforeContent2;
    }
    
    @Column(name="afterContent2_", length=150)
    @Field
    public String getAfterContent2() {
        return this.afterContent2;
    }
    
    public void setAfterContent2(String afterContent2) {
        this.afterContent2 = afterContent2;
    }
    
    @Column(name="items1_", length=50)
    @Field
    public String getItems1() {
        return this.items1;
    }
    
    public void setItems1(String items1) {
        this.items1 = items1;
    }
    
    @Column(name="beforeContent1_", length=150)
    @Field
    public String getBeforeContent1() {
        return this.beforeContent1;
    }
    
    public void setBeforeContent1(String beforeContent1) {
        this.beforeContent1 = beforeContent1;
    }
    
    @Column(name="afterContent1_", length=150)
    @Field
    public String getAfterContent1() {
        return this.afterContent1;
    }
    
    public void setAfterContent1(String afterContent1) {
        this.afterContent1 = afterContent1;
    }*/
    
    @Column(name="reason", length=150)
    @Field
    public String getReason() {
        return this.reason;
    }
    
    public void setReason(String reason) {
        this.reason = reason;
    }
    
    @Column(name="applyType", length=50)
    @Field
    public String getApplyType() {
        return "代理人";
    }
    
    public void setApplyType(String applyType) {
        this.applyType = applyType;
    }
    
    @Column(name="shenqr", length=50)
    @Field
    public String getShenqr() {
        return "申请人";
    }
    
    public void setShenqr(String shenqr) {
        this.shenqr = shenqr;
    }
    
    @Column(name="dailr", length=50)
    @Field
    public String getDailr() {
        return "代理人";
    }
    
    public void setDailr(String dailr) {
        this.dailr = dailr;
    }
    
    @Column(name="sqrname", length=50)
    @Field
    public String getSqrname() {
        return this.sqrname;
    }
    
    public void setSqrname(String sqrname) {
        this.sqrname = sqrname;
    }
    
    @Column(name="sqraddress", length=50)
    @Field
    public String getSqraddress() {
        return this.sqraddress;
    }
    
    public void setSqraddress(String sqraddress) {
        this.sqraddress = sqraddress;
    }
    
    @Column(name="sqrpostCode", length=50)
    @Field
    public String getSqrpostCode() {
        return this.sqrpostCode;
    }
    
    public void setSqrpostCode(String sqrpostCode) {
        this.sqrpostCode = sqrpostCode;
    }
    
    @Column(name="sqrcontactPerson", length=50)
    @Field
    public String getSqrcontactPerson() {
        return this.sqrcontactPerson;
    }
    
    public void setSqrcontactPerson(String sqrcontactPerson) {
        this.sqrcontactPerson = sqrcontactPerson;
    }
    
    @Column(name="sqrphone", length=50)
    @Field
    public String getSqrphone() {
        return this.sqrphone;
    }
    
    public void setSqrphone(String sqrphone) {
        this.sqrphone = sqrphone;
    }
    
    @Column(name="sqremail", length=50)
    @Field
    public String getSqremail() {
        return this.sqremail;
    }
    
    public void setSqremail(String sqremail) {
        this.sqremail = sqremail;
    }
    
    @Column(name="sqrmobile", length=50)
    @Field
    public String getSqrmobile() {
        return this.sqrmobile;
    }
    
    public void setSqrmobile(String sqrmobile) {
        this.sqrmobile = sqrmobile;
    }
    
    @Column(name="sqrfax", length=50)
    @Field
    public String getSqrfax() {
        return this.sqrfax;
    }
    
    public void setSqrfax(String sqrfax) {
        this.sqrfax = sqrfax;
    }
    
    @Column(name="agentDesc", length=150)
    @Field
    public String getAgentDesc() {
    	return Constants.AGENT_DESC;
    }
    
    public void setAgentDesc(String agentDesc) {
        this.agentDesc = agentDesc;
    }
    
    @Column(name="dlrname", length=50)
    @Field
    public String getDlrname() {
    	return Constants.AGENT_NAME;
    }
    
    public void setDlrname(String dlrname) {
        this.dlrname = dlrname;
    }
    
    @Column(name="dlraddress", length=50)
    @Field
    public String getDlraddress() {
        return Constants.AGENT_ADDRESS;
    }
    
    public void setDlraddress(String dlraddress) {
        this.dlraddress = dlraddress;
    }
    
    @Column(name="dlrpostCode", length=50)
    @Field
    public String getDlrpostCode() {
        return Constants.AGENT_POSTCODE;
    }
    
    public void setDlrpostCode(String dlrpostCode) {
        this.dlrpostCode = dlrpostCode;
    }
    
    @Column(name="dlrcontactPerson", length=50)
    @Field
    public String getDlrcontactPerson() {
        return Constants.AGENT_CONTACT;
    }
    
    public void setDlrcontactPerson(String dlrcontactPerson) {
        this.dlrcontactPerson = dlrcontactPerson;
    }
    
    @Column(name="dlrphone", length=50)
    @Field
    public String getDlrphone() {
        return Constants.AGENT_PHONE;
    }
    
    public void setDlrphone(String dlrphone) {
        this.dlrphone = dlrphone;
    }
    
    @Column(name="state")
    @Field
    public Integer getState() {
        return this.state;
    }
    
    public void setState(Integer state) {
        this.state = state;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="applyTime", length=19)
    @Field
    public Date getApplyTime() {
        return this.applyTime;
    }
    
    @ManyToOne
    @JoinColumn(name="applicant_id", nullable=true, insertable = true, updatable = true) 
    public User getApplicant() {
		return applicant;
	}

	public void setApplicant(User applicant) {
		this.applicant = applicant;
	}
	
	@ManyToOne
    @JoinColumn(name="reviewer_id", nullable=true, insertable = true, updatable = true) 
	public User getReviewer() {
		return reviewer;
	}

	public void setReviewer(User reviewer) {
		this.reviewer = reviewer;
	}

	public void setApplyTime(Date applyTime) {
        this.applyTime = applyTime;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="updateTime", length=19)
    @Field
    public Date getUpdateTime() {
        return this.updateTime;
    }
    
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CopyrightAlteration pojo = (CopyrightAlteration) o;

        if (loginId != null ? !loginId.equals(pojo.loginId) : pojo.loginId != null) return false;
        if (copyrighter != null ? !copyrighter.equals(pojo.copyrighter) : pojo.copyrighter != null) return false;
        if (proveFile != null ? !proveFile.equals(pojo.proveFile) : pojo.proveFile != null) return false;
        if (kind != null ? !kind.equals(pojo.kind) : pojo.kind != null) return false;
        if (softFullName != null ? !softFullName.equals(pojo.softFullName) : pojo.softFullName != null) return false;
        if (originalRegType != null ? !originalRegType.equals(pojo.originalRegType) : pojo.originalRegType != null) return false;
        if (originalRegNumber != null ? !originalRegNumber.equals(pojo.originalRegNumber) : pojo.originalRegNumber != null) return false;
        if (originalChangeNumber != null ? !originalChangeNumber.equals(pojo.originalChangeNumber) : pojo.originalChangeNumber != null) return false;
        if (applyingType != null ? !applyingType.equals(pojo.applyingType) : pojo.applyingType != null) return false;
        if (items != null ? !items.equals(pojo.items) : pojo.items != null) return false;
        if (beforeContent != null ? !beforeContent.equals(pojo.beforeContent) : pojo.beforeContent != null) return false;
        if (afterContent != null ? !afterContent.equals(pojo.afterContent) : pojo.afterContent != null) return false;
        /*if (items2 != null ? !items2.equals(pojo.items2) : pojo.items2 != null) return false;
        if (beforeContent2 != null ? !beforeContent2.equals(pojo.beforeContent2) : pojo.beforeContent2 != null) return false;
        if (afterContent2 != null ? !afterContent2.equals(pojo.afterContent2) : pojo.afterContent2 != null) return false;
        if (items1 != null ? !items1.equals(pojo.items1) : pojo.items1 != null) return false;
        if (beforeContent1 != null ? !beforeContent1.equals(pojo.beforeContent1) : pojo.beforeContent1 != null) return false;
        if (afterContent1 != null ? !afterContent1.equals(pojo.afterContent1) : pojo.afterContent1 != null) return false;*/
        if (reason != null ? !reason.equals(pojo.reason) : pojo.reason != null) return false;
        if (applyType != null ? !applyType.equals(pojo.applyType) : pojo.applyType != null) return false;
        if (shenqr != null ? !shenqr.equals(pojo.shenqr) : pojo.shenqr != null) return false;
        if (dailr != null ? !dailr.equals(pojo.dailr) : pojo.dailr != null) return false;
        if (sqrname != null ? !sqrname.equals(pojo.sqrname) : pojo.sqrname != null) return false;
        if (sqraddress != null ? !sqraddress.equals(pojo.sqraddress) : pojo.sqraddress != null) return false;
        if (sqrpostCode != null ? !sqrpostCode.equals(pojo.sqrpostCode) : pojo.sqrpostCode != null) return false;
        if (sqrcontactPerson != null ? !sqrcontactPerson.equals(pojo.sqrcontactPerson) : pojo.sqrcontactPerson != null) return false;
        if (sqrphone != null ? !sqrphone.equals(pojo.sqrphone) : pojo.sqrphone != null) return false;
        if (sqremail != null ? !sqremail.equals(pojo.sqremail) : pojo.sqremail != null) return false;
        if (sqrmobile != null ? !sqrmobile.equals(pojo.sqrmobile) : pojo.sqrmobile != null) return false;
        if (sqrfax != null ? !sqrfax.equals(pojo.sqrfax) : pojo.sqrfax != null) return false;
        if (agentDesc != null ? !agentDesc.equals(pojo.agentDesc) : pojo.agentDesc != null) return false;
        if (dlrname != null ? !dlrname.equals(pojo.dlrname) : pojo.dlrname != null) return false;
        if (dlraddress != null ? !dlraddress.equals(pojo.dlraddress) : pojo.dlraddress != null) return false;
        if (dlrpostCode != null ? !dlrpostCode.equals(pojo.dlrpostCode) : pojo.dlrpostCode != null) return false;
        if (dlrcontactPerson != null ? !dlrcontactPerson.equals(pojo.dlrcontactPerson) : pojo.dlrcontactPerson != null) return false;
        if (dlrphone != null ? !dlrphone.equals(pojo.dlrphone) : pojo.dlrphone != null) return false;
        if (state != null ? !state.equals(pojo.state) : pojo.state != null) return false;
        if (applyTime != null ? !applyTime.equals(pojo.applyTime) : pojo.applyTime != null) return false;
        if (updateTime != null ? !updateTime.equals(pojo.updateTime) : pojo.updateTime != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (loginId != null ? loginId.hashCode() : 0);
        result = 31 * result + (copyrighter != null ? copyrighter.hashCode() : 0);
        result = 31 * result + (proveFile != null ? proveFile.hashCode() : 0);
        result = 31 * result + (kind != null ? kind.hashCode() : 0);
        result = 31 * result + (softFullName != null ? softFullName.hashCode() : 0);
        result = 31 * result + (originalRegType != null ? originalRegType.hashCode() : 0);
        result = 31 * result + (originalRegNumber != null ? originalRegNumber.hashCode() : 0);
        result = 31 * result + (originalChangeNumber != null ? originalChangeNumber.hashCode() : 0);
        result = 31 * result + (applyingType != null ? applyingType.hashCode() : 0);
        result = 31 * result + (items != null ? items.hashCode() : 0);
        result = 31 * result + (beforeContent != null ? beforeContent.hashCode() : 0);
        result = 31 * result + (afterContent != null ? afterContent.hashCode() : 0);
      /*  result = 31 * result + (items2 != null ? items2.hashCode() : 0);
        result = 31 * result + (beforeContent2 != null ? beforeContent2.hashCode() : 0);
        result = 31 * result + (afterContent2 != null ? afterContent2.hashCode() : 0);
        result = 31 * result + (items1 != null ? items1.hashCode() : 0);
        result = 31 * result + (beforeContent1 != null ? beforeContent1.hashCode() : 0);
        result = 31 * result + (afterContent1 != null ? afterContent1.hashCode() : 0);*/
        result = 31 * result + (reason != null ? reason.hashCode() : 0);
        result = 31 * result + (applyType != null ? applyType.hashCode() : 0);
        result = 31 * result + (shenqr != null ? shenqr.hashCode() : 0);
        result = 31 * result + (dailr != null ? dailr.hashCode() : 0);
        result = 31 * result + (sqrname != null ? sqrname.hashCode() : 0);
        result = 31 * result + (sqraddress != null ? sqraddress.hashCode() : 0);
        result = 31 * result + (sqrpostCode != null ? sqrpostCode.hashCode() : 0);
        result = 31 * result + (sqrcontactPerson != null ? sqrcontactPerson.hashCode() : 0);
        result = 31 * result + (sqrphone != null ? sqrphone.hashCode() : 0);
        result = 31 * result + (sqremail != null ? sqremail.hashCode() : 0);
        result = 31 * result + (sqrmobile != null ? sqrmobile.hashCode() : 0);
        result = 31 * result + (sqrfax != null ? sqrfax.hashCode() : 0);
        result = 31 * result + (agentDesc != null ? agentDesc.hashCode() : 0);
        result = 31 * result + (dlrname != null ? dlrname.hashCode() : 0);
        result = 31 * result + (dlraddress != null ? dlraddress.hashCode() : 0);
        result = 31 * result + (dlrpostCode != null ? dlrpostCode.hashCode() : 0);
        result = 31 * result + (dlrcontactPerson != null ? dlrcontactPerson.hashCode() : 0);
        result = 31 * result + (dlrphone != null ? dlrphone.hashCode() : 0);
        result = 31 * result + (state != null ? state.hashCode() : 0);
        result = 31 * result + (applyTime != null ? applyTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("id").append("='").append(getId()).append("', ");
        sb.append("loginId").append("='").append(getLoginId()).append("', ");
        sb.append("copyrighter").append("='").append(getCopyrighter()).append("', ");
        sb.append("proveFile").append("='").append(getProveFile()).append("', ");
        sb.append("kind").append("='").append(getKind()).append("', ");
        sb.append("softFullName").append("='").append(getSoftFullName()).append("', ");
        sb.append("originalRegType").append("='").append(getOriginalRegType()).append("', ");
        sb.append("originalRegNumber").append("='").append(getOriginalRegNumber()).append("', ");
        sb.append("originalChangeNumber").append("='").append(getOriginalChangeNumber()).append("', ");
        sb.append("applyingType").append("='").append(getApplyingType()).append("', ");
        sb.append("items").append("='").append(getItems()).append("', ");
        sb.append("beforeContent").append("='").append(getBeforeContent()).append("', ");
        sb.append("afterContent").append("='").append(getAfterContent()).append("', ");
        /*sb.append("items2").append("='").append(getItems2()).append("', ");
        sb.append("beforeContent2").append("='").append(getBeforeContent2()).append("', ");
        sb.append("afterContent2").append("='").append(getAfterContent2()).append("', ");
        sb.append("items1").append("='").append(getItems1()).append("', ");
        sb.append("beforeContent1").append("='").append(getBeforeContent1()).append("', ");
        sb.append("afterContent1").append("='").append(getAfterContent1()).append("', ");*/
        sb.append("reason").append("='").append(getReason()).append("', ");
        sb.append("applyType").append("='").append(getApplyType()).append("', ");
        sb.append("shenqr").append("='").append(getShenqr()).append("', ");
        sb.append("dailr").append("='").append(getDailr()).append("', ");
        sb.append("sqrname").append("='").append(getSqrname()).append("', ");
        sb.append("sqraddress").append("='").append(getSqraddress()).append("', ");
        sb.append("sqrpostCode").append("='").append(getSqrpostCode()).append("', ");
        sb.append("sqrcontactPerson").append("='").append(getSqrcontactPerson()).append("', ");
        sb.append("sqrphone").append("='").append(getSqrphone()).append("', ");
        sb.append("sqremail").append("='").append(getSqremail()).append("', ");
        sb.append("sqrmobile").append("='").append(getSqrmobile()).append("', ");
        sb.append("sqrfax").append("='").append(getSqrfax()).append("', ");
        sb.append("agentDesc").append("='").append(getAgentDesc()).append("', ");
        sb.append("dlrname").append("='").append(getDlrname()).append("', ");
        sb.append("dlraddress").append("='").append(getDlraddress()).append("', ");
        sb.append("dlrpostCode").append("='").append(getDlrpostCode()).append("', ");
        sb.append("dlrcontactPerson").append("='").append(getDlrcontactPerson()).append("', ");
        sb.append("dlrphone").append("='").append(getDlrphone()).append("', ");
        sb.append("state").append("='").append(getState()).append("', ");
        sb.append("applyTime").append("='").append(getApplyTime()).append("', ");
        sb.append("updateTime").append("='").append(getUpdateTime()).append("', ");
        sb.append("]");
      
        return sb.toString();
    }

}
